import datetime
from applications.extensions import db


class Article(db.Model):
    __tablename__ = 'admin_article'
    article_id = db.Column(db.Integer, primary_key=True, comment='文章id')
    title = db.Column(db.String(255), comment='标题')
    content = db.Column(db.Text, comment="内容")
    type = db.Column(db.Integer, default=1, comment='类型')
    status = db.Column(db.Integer, default=1, comment='状态')
    admin_id = db.Column(db.Integer, comment='发布者')
    image = db.Column(db.String(255), comment='封面图')
    video = db.Column(db.String(255), comment='视频')
    pub_time = db.Column(db.DateTime, comment='发布时间')
    recipient_uid = db.Column(db.Integer, comment='接收人')
    introduction = db.Column(db.Text, comment='简介')
    create_time = db.Column(db.DateTime, default=datetime.datetime.now, comment='创建时间')
    update_time = db.Column(db.DateTime, default=datetime.datetime.now, onupdate=datetime.datetime.now, comment='更新时间')
